// $Header: $

using System;
using System.Data;
using System.Collections;
using System.Collections.Generic;

namespace LogParser.Collections
{
    /// <summary>
    /// Summary description for LogParser.Collections.ClassList.
    /// </summary>
    public class ClassList
    {
        #region Private Member Variables

        DA.ClassListModel _model;
        Hashtable _classList = new Hashtable();

        #endregion

        #region Constructor
        /// <summary>
        /// Initializes a new instance of the <see cref="ClassList"/> class.
        /// </summary>
        public ClassList()
        {
            Initialize();
        }

        /// <summary>
        /// Initialize method
        /// </summary>
        private void Initialize()
        {
            _model = new LogParser.DA.ClassListModel();
            _classList = new Hashtable();

            List<GameObjects.Class> classList = _model.GetClassList();

            foreach ( GameObjects.Class tempClass in classList )
            {
                _classList.Add( tempClass.ShortName, tempClass );
            }

        }

        #endregion

        #region Public Properties

        public Hashtable GetClassList
        {
            get
            {
                return _classList;
            }
        }

        #endregion

        #region Private Properties

        #endregion

        #region Public Member Functions

        public GameObjects.Class GetClass( string shortName )
        {
            GameObjects.Class returnClass = new LogParser.GameObjects.Class();

            if ( shortName == string.Empty )
                shortName = "scout";

            returnClass = ( GameObjects.Class ) ( _classList[ shortName ] );


            return returnClass;
        }

        public GameObjects.Class GetClass( int classId )
        {
            GameObjects.Class returnClass = new LogParser.GameObjects.Class();

            foreach ( GameObjects.Class tempClass in _classList.Values )
            {
                if ( tempClass.ID == classId )
                    return tempClass;
            }

            return new LogParser.GameObjects.Class();
        }

        #endregion

        #region Private Member Functions

        #endregion
    }
}

#region VSS Log

/*
 * $Log: $
 */

#endregion VSS Log